package com.marveal.rabbit.api;

import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * $Message 消息体
 */
@Setter
@Getter
@Accessors(chain = true)
@NoArgsConstructor()
@AllArgsConstructor()
@ToString
public class Message implements Serializable {

    private static final long serialVersionUID = 6742248537310337689L;

    /**
     *  消息的唯一ID
     *  default: UUID.randomUUID().toString().replace("-", "")
     */
    private String messageId;

    /** 消息的主题 */
    private String topic;

    /** 消息的路由规则 */
    private String routingKey;

    /** 消息的附加属性 */
    private Map<String, Object> attributes = new HashMap<>();

    /** 延迟消息的参数配置 */
    private int delayMills;

    /** 消息类型 */
    private MessageType messageType = MessageType.CONFIRM;
}
